package com.dstation.pay;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000116689935";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCIo2vqtIfMGXQ39+Qj5BG6h0GyJzfbgJodzuu4vyWx4tazjlQ6etb90xyesG4mpXPwwoCrHFjVGOOcJytP4tyHUrDepDKCHZF/h6/D0/8gUjVcCdDTu9wPkoqJin3xg7pjtaNH/I+p1jUFIpQoZTciesCL4ZGv7JLStaASDufgGFsABetCcgPQWGVe2t7z6UjiMWnjsS2yMj5HvrdfdigGbrAgUK/uTDz8kbqRvekU+qVyXdOPX3zstGdrdSukaDYPxgdlb15lR7JgbBe7A1XHSNAH4gmeo9BCapXCQ8aCn8bZahqvZ5K8NIUdgfNEJ4ItYHkfsWFSqS6sFePH3VnBAgMBAAECggEAFqLEGQDJUmWRHEiD0fJRgY4wsvvORB3c6j1CTbvU2dBTczGMAJgjD6+umRdvWBWmzGbce/xZNwxFgLP4d+aEVCK9zFR1TZrqZK8szgtLw6X60wGJR9piTW4gZ0K7NIx3D1ei8iUEA8XJyMz+sGZ8KMkfJs06nmNZu3B9USCJB1WjglkKkCVYjNcBBMc09y16oH4BfR47B8y/JQs4MffFjxfF4r5yXNt9EFrYyif5VxYD3EHVRW9narfwrjaJnTSnPFbn7QQWtagvN5L0dEJOKUzKeLS+aGt9XEkzl6eqNBcQimOI8xdw6ZZjEp554TE5Lx2BPfLLu6i8jlQY6ot1JQKBgQDGYt/uMaR9k2ihhgal91CLHlwQd8TCchvxHPrC5LfKG3YfpbJqYzU17OAM/QJLFaPTjyrEF3SL0r1OVoCTBalgfy1G0f1/2Sx8SiBrqkL9fdftcOvRSKcrf7j09YkAA82nRXVhiwGHLV/Z97MIxE3+6UlJqAMhx0Ac1rTJUVdoXwKBgQCwUd7UFJnqolaA0PjGyIXt/DhV4btq8W6VXyZkjBlGrAGqnb5WQPvduwXmVhCVylkhxIGpRQSNZ8q8aWlFOfAUtdMy7+wcVLibFS7tqGs2vi7YUi0QDwQHcevxR3QclstpdvOhbiUzvH8nk0YY705u9M0FLeBusT56/tb+b4jx3wKBgQC2sBCkqaRfW6Krs99lcHUEV6XSKGjR4wDmLZiiZrr07AsAI7dEDy3OBd9hNpCpEjl2Nc3dG/hgVmWrwS7PtRP/372TDQdTd2tm3WAzpWvhQcTZS/ZtGGmRPiHVulI56Ea2tdjdRYPXtqog7+A3v4ZPqwapRIX10iWxKOr8xOIoIwKBgQCITvKuEDMhcljfgy4gNxta7Vb8BeOm/HjaH1IF/0z3Fri/Fu3zro9ITnJ0LGrr8h/P/COlIYcwbmIMII3Sh8TzrdFVmqd1C4Yf1lOORVqFWqfKclUGCiW6P7cAs5WvGGCu6tfUH9vA0GOYy8EwO6juHHB3JY1Q5dOAsIyy7LT5DwKBgAmRJ6/bxdgW0vdZ/SVDhOldcQ0S9TpJu8iQUx7OIbO3Q8dyjS00JfjthOXtafM3DkofKTs3KzocCFJBd9/QSDOHeBVWJG+xs8ugi81OvRC7emUdlXhJjuEGXpK9yIPAtNBQzi/Np78HoOK55slpNsz6SwsBMznlMMFyYYmoYw4u";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxtvKBX2MwgB7hZdbmmOrwLSGakhJmLJ+E6wT/PdwfnQcHwPJdvd5ZGkJcNL77CVMYTgbGwLSrxlznblNahqdwZnBm4wVFiDR56Pb6B0kQ9c3lLSmJChETblwiJLXFDVd9JjeVTd8Ojcu/xD4HZQNne6LZ0mbRySoaOU7Z0G16gdwMaKqT6cnvhJT+ernPt8ihRd6puyOKMuvEdej40weTEQsemCTr7hB3OFNklLdAdLyDuICuqV5dXb8fKSmWXFX5nmfbB2MNJRX9Ccr1cMbdOfGIM97UBdS+KufWmksBF/3TP3ZKfgsQDWMoWSTe+jitd143YhDc7Ow0IFrCp6utQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/aliPay/notifyUrl";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url = "http://localhost:8080/aliPay/returnUrl";

	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

